package com.wt.service;

import com.wt.dao.TravelDao;
import com.wt.entity.Travel;

import java.sql.SQLException;
import java.util.List;

public class TravelService {
    TravelDao travelDao = new TravelDao();
    public List<Travel> searchTravel(String search) throws SQLException {
        List<Travel> travels = travelDao.searchTravel(search);
        if (travels == null || 0 == travels.size()){
            return null;
        }
        for(int i = 0; i < travels.size();i++){
            travels.get(i).setScenicImage("http://localhost:8188" + travels.get(i).getScenicImage());
        }
        return travels;
    }
}
